package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.ArticleCategoryType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by anti on 2016-08-22.
 */
@Entity
@Table(name = "article")
@DynamicInsert
@DynamicUpdate
public class Article extends IDEntityMall {

    @Column(columnDefinition = "varchar(100) comment '标题'")
    private String name;

    @Column(columnDefinition = "varchar(255) comment '关键字'")
    private String keyword;

    @Column(columnDefinition = "int comment '显示顺序'")
    private Integer displayOrderId;

    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;

    @Column(columnDefinition = "bigint comment '父分类Id'")
    private Long parentCategoryId;

    @Column(columnDefinition = "bigint comment '分类Id'")
    private Long categoryId;

    @Column(columnDefinition = "text comment '文章详情'")
    private String content;

    @Column(columnDefinition = "bigint comment '点击次数'")
    private Long clickCounts = 0l;

    public static final String ATTR_THIS = "article";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDisplayOrderId() {
        return displayOrderId;
    }

    public void setDisplayOrderId(Integer displayOrderId) {
        this.displayOrderId = displayOrderId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getParentCategoryId() {
        return parentCategoryId;
    }

    public void setParentCategoryId(Long parentCategoryId) {
        this.parentCategoryId = parentCategoryId;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public Long getClickCounts() {
        return clickCounts;
    }

    public void setClickCounts(Long clickCounts) {
        this.clickCounts = clickCounts;
    }

    @Override
    public String toString() {
        return "Article{" +
                "name='" + name + '\'' +
                ", keyword='" + keyword + '\'' +
                ", displayOrderId=" + displayOrderId +
                ", mallId=" + mallId +
                ", parentCategoryId=" + parentCategoryId +
                ", categoryId=" + categoryId +
                ", content='" + content + '\'' +
                ", clickCounts=" + clickCounts +
                '}';
    }
}
